#include "TrueText/Config.h"
#include "TrueText/Text.h"
#include "TrueText/Font.h"
#include "TextImpl.h"

namespace TrueText {

Text::Text(const Font& font)
	: impl(new TextImpl(font.getImpl(), LEFT))
{ }

Text::Text(const Text& rhs)
    : impl(rhs.impl)
{ }

const Text& Text::operator=(const Text& rhs)
{
    if (this == &rhs)
        return *this;

    impl = rhs.impl;

    return *this;
}

Text::~Text()
{ }

const std::wstring& Text::GetString() const
{
    return impl->GetString();
}

void Text::SetString(const std::wstring& value)
{
	impl->SetString(value);
}

int Text::GetClipWidth() const
{
	return impl->GetClipWidth();
}

void Text::SetClipWidth(int value)
{
	impl->SetClipWidth(value);
}
	
void Text::SetTextAlign(TextAlign align)
{
	impl->SetTextAlign(align);
}
	
TextAlign Text::GetTextAlign() const
{
	return impl->GetTextAlign();
}

const TextBounds& Text::GetBounds()
{
	return impl->GetBounds();
}

void Text::Render(const BitmapInfo& output)
{
	impl->Render(output);
}

void Text::Render(const BitmapInfo& output, const Point& offset)
{
	impl->Render(output, offset);
}

const TextLayout& Text::GetLayout()
{
	return impl->GetLayout();
}

}